import MusicManager from "../../MusicManager";
import Scene from "../../Scene";
import { TButton, TLayout } from "../../SceneControl";

const { ccclass, menu } = cc._decorator;

@ccclass
@menu("Scene/HelpPopScene")
export default class HelpPopScene extends Scene {

    protected onEnable(): void {
        super.onEnable();
        this.initScene();
    }

    public initScene() {
        let layout = new TLayout();
        layout.buttonList = [
            [new TButton(this.node.children[1])]
        ];
        this.tscene.addLayout(layout);
        this.tscene.onBack = this.cancel.bind(this);
        this.tscene.joinController();
    }

    cancel() {
        MusicManager.instance.play(MusicManager.instance.btnMove);
        this.node.destroy();
    }

}
